.\"   $Id: viewht.3,v 1.1 2002/03/08 13:51:04 fred Exp $
.\" @(#)viewht.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
.\" slightly modified by Fred Petrot for mbk adaptation on 22/06/92
.if t \{\
.so man1/alc_contents.mac
.XS \n%
.ti 0.2i
viewht
.XE
.XS4 \n%
.ti 0.2i
viewht
.XE4 \}
.TH VIEWHT 3 "October 1, 1997" "ASIM/LIP6" "MBK HASH TABLE MANAGEMENT FUNCTIONS"
.SH NAME
viewht \- displays a hash table contents
.so man1/alc_origin.1
.SH SYNOPSIS
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
.nf
#include "mut.h"
void viewht(table, display)
ht \(**table;
char \(**(\(**display)();
.fi
.ft R
.SH PARAMETER
.TP 20
\fItable\fP
Hash table to be viewed
.TP 20
\fIdisplay\fP
Function to be used for displaying an item of the table
This function needs a user supplied parameter, the pointer
to the item.
.SH DESCRIPTION
\fBviewht()\fP displays all items of \fItable\fP :
.TP 20
index 
This is the entry index of the hash table
.TP
key
This pointer is the one given by the user.
It is displayed using something like
.br
\fBfprintf(stdout, "%s\\n", \fIdisplay(key)\fP);\fP.
.TP
value
This is the value associated with the key.
It is displayed as an \fIint\fP.
.LP
.SH EXAMPLE
.ta 3n 6n 9n 12n 15n 18n 21n
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
.nf
#include "mut.h"
#include <stdio.h>
typedef struct of_fp {
	char \(**name;
	float f;
	void \(**p;
} fp;
char \(**printout(s)
fp \(**s;
{
char t[BUFSIZ];
	sprintf(t, "name : `%s' :~~~: float value : `%.6f' <%#x>",
		s->name, s->f, s->p);
	return t;
}
void displayall(h)
ht *h;
{
	viewht(h, printout);
}
.fi
.ft R
.SH SEE ALSO
.BR mbk (1),
.BR addht (3),
.BR delht (3),
.BR addhtitem (3),
.BR gethtitem (3),
.BR sethtitem (3),
.BR delhtitem (3).


.so man1/alc_bug_report.1

